package com.woniuxy.credit_loans.staff_dong.controller;

import com.woniuxy.credit_loans.entity.Dept;
import com.woniuxy.credit_loans.staff_dong.service.DeptService;
import com.woniuxy.credit_loans.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/depts")
public class DeptController {

    @Autowired
    private DeptService deptService;

    @GetMapping("")
    public Result selAllDepts(){
        List<Dept> depts = deptService.selAll();
        return Result.ok().data("deptList",depts);
    }
}
